package main

import (
	"fmt"
	"regexp"
)

const text = `
My email is ccmouse@gmail.com
email is abc@def.org
email2 is     kkk@qqqq.cn
email3 is ddd@abc.com.cn
`

func main() {
	//re, e := regexp.Compile("ccmouse@gmail.com")
	re := regexp.MustCompile(`([a-zA-Z0-9]+)@([a-zA-Z0-9]+)(\.[a-zA-Z0-9.]+)`)

	//match := re.FindString(text)
	//match := re.FindAllString(text, -1)
	match := re.FindAllStringSubmatch(text, -1)

	fmt.Println(match)
}